package com.linkgie.galaxyframework.httpproxy;

import java.util.Properties;

/**
 * HTTP 函数；
 * 
 * <p>
 * 封装了一项具体的 HTTP 请求；
 * 
 */
public interface HttpFunction<T> {

    default T request() throws HttpRequestException {
        return request(null, null, null);
    }

    default T request(Object[] args) throws HttpRequestException {
        return request(null, null, args);
    }

    default T request(Properties params) throws HttpRequestException {
        return request(null, params, null);
    }

    default T request(Properties headers, Properties params) throws HttpRequestException {
        return request(headers, params, null);
    }

    /**
     * 执行 HTTP 请求；
     * 
     * @param args 请求参数；
     * @return 回复结果；
     * @throws HttpRequestException
     */
    T request(Properties header, Properties params, Object[] args) throws HttpRequestException;

}
